home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / cstdio.arc / SRC.ARC / BRK.A < prev    next >
Text File  |  1984-08-01  |  508b  |  33 lines

  1. ;    brk.a - change memory allocation.
  2. ;    (C) Copyright 1984 Gregory R. Mansfield - All Rights Reserved
  3. ;    G. R. Mansfield.  84/06/04.
  4. ;    Ver 1.1-4801.
  5.  
  6.  
  7.     dseg
  8.     public    _mcv
  9.  
  10.     cseg
  11.     public    brk_
  12.     public    sbrk_
  13.  
  14.  
  15. ;    int BYTE *brk(addr)
  16. ;    BYTE *addr;
  17.  
  18. brk_:    mov    bx,sp        ; set current address
  19.     mov    ax,[bx+2]
  20. brk1:    mov    _mcv+2,ax
  21.     ret
  22.  
  23.  
  24. ;    int BYTE *sbrk(incr)
  25. ;    unsigned incr;
  26.  
  27. sbrk_:    mov    bx,sp        ; add increment to current address
  28.     mov    cx,[bx+2]
  29.     mov    ax,_mcv+2
  30.     add    cx,ax
  31.     mov    _mcv+2,cx
  32.     ret
  33.